home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH5 / 5-3-5.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.5 KB  |  79 lines

  1. VERSION 5.00
  2. Begin VB.Form frm5_3_5 
  3.    Caption         =   "Analyze First Character of a String"
  4.    ClientHeight    =   1275
  5.    ClientLeft      =   1230
  6.    ClientTop       =   1710
  7.    ClientWidth     =   5790
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1275
  20.    ScaleWidth      =   5790
  21.    Begin VB.PictureBox picResult 
  22.       Height          =   495
  23.       Left            =   1440
  24.       ScaleHeight     =   435
  25.       ScaleWidth      =   4155
  26.       TabIndex        =   2
  27.       Top             =   600
  28.       Width           =   4215
  29.    End
  30.    Begin VB.CommandButton cmdAnalyze 
  31.       Caption         =   "Analyze"
  32.       Height          =   495
  33.       Left            =   120
  34.       TabIndex        =   1
  35.       Top             =   600
  36.       Width           =   1215
  37.    End
  38.    Begin VB.TextBox txtString 
  39.       Height          =   285
  40.       Left            =   1560
  41.       TabIndex        =   0
  42.       Text            =   " "
  43.       Top             =   120
  44.       Width           =   4095
  45.    End
  46.    Begin VB.Label lblEnter 
  47.       Caption         =   "Enter any string"
  48.       Height          =   255
  49.       Left            =   120
  50.       TabIndex        =   3
  51.       Top             =   120
  52.       Width           =   1455
  53.    End
  54. Attribute VB_Name = "frm5_3_5"
  55. Attribute VB_GlobalNameSpace = False
  56. Attribute VB_Creatable = False
  57. Attribute VB_PredeclaredId = True
  58. Attribute VB_Exposed = False
  59. Private Sub cmdAnalyze_Click()
  60.   Dim anyString As String
  61.   'Analyze the first character of a string
  62.   picResult.Cls
  63.   anyString = UCase(txtString.Text)
  64.   Select Case Left(anyString, 1)
  65.     Case "S", "Z"
  66.       picResult.Print "The string begins with a sibilant."
  67.     Case "A" To "Z"
  68.       picResult.Print "The string begins with a nonsibilant."
  69.     Case "0" To "9"
  70.       picResult.Print "The string begins with a digit."
  71.     Case Is < "0"
  72.       picResult.Print "The string begins with a character of ANSI"
  73.       picResult.Print "value less than 48 (e.g. +, &, #, or %)."
  74.     Case Else
  75.       picResult.Print "The string begins with one of the following:"
  76.       picResult.Print "        :  ;  <  =  >  ?  @  [  /  ]  ^  _  '"
  77.   End Select
  78. End Sub
  79.